package com.jack.student;

import java.util.Scanner;

public class DelInfo {
    public static void delInfo(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你要删除的学生学号:");
        long stuNum = scanner.nextLong();
        for (StudentInfo lis: AddInfo.students) {
            if(lis.getStuId() == stuNum){
                AddInfo.students.remove(lis);
                System.out.println("删除成功!");
                break;
            }else if(lis.getStuId() == AddInfo.students.get(AddInfo.students.size()-1).getStuId()){
                System.out.println("你输入的学号不存在,请从新输入:");
            }
        }
    }
}
